package Basic.day06;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class demo {
    public static void main(String[] args) {
        int a = 012;
        char b =  'a';
        System.out.println((a > 11) ? a : b);
        System.out.println((a > 11) ? 65 : b);
        System.out.println((a > 11) ? 65.0 : b);
        char c = 65;

        List<String> list = Arrays.asList("a", "b", "c");
        List<String> newList = list.stream()
                .filter(x -> x.equals("a"))
                .collect(Collectors.toList());
        List<Integer> numList = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
                .stream()
                .filter(x -> x % 2 == 0)
                .collect(Collectors.toList());
        List<Double> sqrtList = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
                .stream()
                .map(x -> Math.sqrt(x))
                .collect(Collectors.toList());
        Integer reduce = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10).stream().reduce(2, (x, y) -> x + y);


    }
}
